﻿using System.Security.Claims;
using Microsoft.AspNetCore.Components.Authorization;

namespace BlazorLearn.Shared;
public class BlazorAuthenticationState : AuthenticationStateProvider
{
    public override Task<AuthenticationState> GetAuthenticationStateAsync()
    {
        //JWT

        //var claimsIdentity = new ClaimsIdentity("Custome");
        //claimsIdentity.AddClaim(new(ClaimTypes.Name, "admin"));
        //claimsIdentity.AddClaim(new(ClaimTypes.Email, "blazor@outlook.com"));

        //var claimsPrincial = new ClaimsPrincipal(claimsIdentity);

        //var state = new AuthenticationState(claimsPrincial);
        //var taskState = Task.FromResult(state);
        //NotifyAuthenticationStateChanged(taskState);
        //return taskState;


        return Task.FromResult(new AuthenticationState(new()));
    }
}
